{template header}
<script src="static/bootstrap/js/utils.js"></script>
<link rel="stylesheet" href="static/calendar/js/calendar.css" />
<script type="text/javascript" charset="utf-8" src="static/calendar/calendar.php"></script>
<form class="form-horizontal" action="index.php?c=admin&a=medalAction" method="post" enctype="multipart/form-data">
  <div class="control-group">
    <label class="control-label" for="">勋章名称：</label>
    <div class="controls">
      <input type="text" name='medal_name' placeholder="勋章名称" value="{$medalInfo['medal_name']}">
    </div>
  </div>
  <div class="control-group">
    <label class="control-label">文案：</label>
    <div class="controls">
        <textarea class="" name="word">{$medalInfo['word']}</textarea>
    </div>
  </div>
  <div class="control-group">
    <label class="control-label" for="">可获取个数：</label>
    <div class="controls">
      <select name="limit">
        <option {if $medalInfo['limit'] == 0}selected="selected"{/if} value="0">无限</option>
        <option {if $medalInfo['limit'] == 1}selected="selected"{/if} value="1">1</option>
        <option {if $medalInfo['limit'] == 2}selected="selected"{/if} value="2">2</option>
        <option {if $medalInfo['limit'] == 3}selected="selected"{/if} value="3">3</option>
        <option {if $medalInfo['limit'] == 4}selected="selected"{/if} value="4">4</option>
        <option {if $medalInfo['limit'] == 5}selected="selected"{/if} value="5">5</option>
      </select>
    </div>
  </div>
  <div class="control-group">
    <label class="control-label" for="">点亮图片：</label>
    <div class="controls">
      <img width="150" src="{$medalInfo['img1']}" alt="">
      <input type="file" name='newImg1' value="{$medalInfo['img1']}">
      <input type="hidden" name='img1' value="{$medalInfo['img1']}">
    </div>
  </div>
  <div class="control-group">
    <label class="control-label" for="">未点亮图片：</label>
    <div class="controls">
      <img width="150" src="{$medalInfo['img2']}" alt="">
      <input type="file" name='newImg2' value="{$medalInfo['img2']}">
      <input type="hidden" name='img2' value="{$medalInfo['img2']}">
    </div>
  </div>
  <div class="control-group">
    <label class="control-label" for="">所属分类：</label>
    <div class="controls">
      <select name="cate">
        {loop $medalCate $id $name}
        <option {if $medalInfo['cate'] == $id}selected="selected"{/if} value="{$id}">{$name}</option>
        {/loop}
      </select>
    </div>
  </div>
  <div class="control-group">
    <label class="control-label" for="">里程要求：</label>
    <div class="controls">
      <input type="text" name='mileage_limit' placeholder="请输入排序号" value="{$medalInfo['mileage_limit']}">km
    </div>
  </div>
  <div class="control-group">
    <label class="control-label" for="">针对人群：</label>
    <div class="controls">
      <select name="gender">
        <option {if $medalInfo['gender'] == 0}selected="selected"{/if} value="0">全部</option>
        <option {if $medalInfo['gender'] == 1}selected="selected"{/if} value="1">男</option>
        <option {if $medalInfo['gender'] == 2}selected="selected"{/if} value="2">女</option>
      </select>
    </div>
  </div>
  <div class="control-group">
    <label class="control-label" for="">勋章分类：</label>
    <div class="controls">
      <select name="isCustom">
        <option {if $medalInfo['isCustom'] == 0}selected="selected"{/if} value="0">系统勋章</option>
        <option {if $medalInfo['isCustom'] == 1}selected="selected"{/if} value="1">不限年份的自定义勋章</option>
        <option {if $medalInfo['isCustom'] == 2}selected="selected"{/if} value="2">生日</option>
        <option {if $medalInfo['isCustom'] == 3}selected="selected"{/if} value="3">限制年份的自定义勋章</option>
        <option {if $medalInfo['isCustom'] == 4}selected="selected"{/if} value="4">手动发放勋章</option>
      </select>
    </div>
  </div>
  <div class="control-group">
    <label class="control-label" for="inputaddtime">设置期限：</label>
    <div class="controls">
      开始时间：<input type="text" name="start_time" id="start_time_id" value="{eval echo $medalInfo['start_time'] ? date('Y-m-d H:i:s', $medalInfo['start_time']) : ''}">
      <input name="start_time_btn" type="button" id="start_time_btn" onclick="return showCalendar('start_time_id', '%Y-%m-%d %H:%M:%S', '24', false, 'start_time_btn');" value="选择" class="button" id="start_time_id"/>
      结束时间：<input type="text" name="end_time" id="end_time_id" value="{eval echo $medalInfo['end_time'] ? date('Y-m-d H:i:s', $medalInfo['end_time']) : ''}">
      <input name="end_time_btn" type="button" id="end_time_btn" onclick="return showCalendar('end_time_id', '%Y-%m-%d %H:%M:%S', '24', false, 'end_time_btn');" value="选择" class="button" id="end_time_id"/>
    </div>
  </div>
  <div class="control-group">
    <div class="controls">
        <input type="hidden" name="medal_id" value="{$medalInfo['medal_id']}">
        <button type="submit" class="btn">提交</button>
    </div>
  </div>
</form>
{template footer}